<template>
	<view class="container">
		<view class="store-header">
			<text class="store-name">{{ storeInfo.name }}</text>
			<text class="store-address">{{ storeInfo.address }}</text>
		</view>
		
		<view class="store-info-section">
			<view class="info-item">
				<text class="info-label">营业时间</text>
				<text class="info-value">{{ storeInfo.businessHours }}</text>
			</view>
			<view class="info-item">
				<text class="info-label">联系电话</text>
				<text class="info-value" @click="callStore">{{ storeInfo.phone }}</text>
			</view>
			<view class="info-item">
				<text class="info-label">门店类型</text>
				<text class="info-value">{{ storeInfo.type }}</text>
			</view>
		</view>
		
		<view class="store-services">
			<text class="section-title">门店服务</text>
			<view class="service-list">
				<view class="service-item" v-for="(service, index) in storeInfo.services" :key="index">
					<text class="service-icon">{{ service.icon }}</text>
					<text class="service-name">{{ service.name }}</text>
				</view>
			</view>
		</view>
		
		<view class="action-buttons">
			<button class="action-btn primary" @click="navigateToStore">导航前往</button>
			<button class="action-btn secondary" @click="callStore">拨打电话</button>
		</view>
	</view>
</template>

<script>
export default {
	data() {
		return {
			storeInfo: {
				name: '体彩门店(朝阳店)',
				address: '北京市朝阳区建国路88号',
				phone: '010-12345678',
				businessHours: '09:00-21:00',
				type: '标准门店',
				services: [
					{ icon: '🎫', name: '彩票销售' },
					{ icon: '🏆', name: '兑奖服务' },
					{ icon: '📱', name: '手机充值' },
					{ icon: '💳', name: '便民缴费' }
				]
			}
		}
	},
	onLoad(options) {
		if (options.id) {
			this.loadStoreInfo(options.id)
		}
	},
	methods: {
		loadStoreInfo(storeId) {
			// 根据门店ID加载门店信息
			console.log('加载门店信息:', storeId)
		},
		callStore() {
			uni.makePhoneCall({
				phoneNumber: this.storeInfo.phone
			})
		},
		navigateToStore() {
			uni.openLocation({
				latitude: 39.908823,
				longitude: 116.397470,
				name: this.storeInfo.name,
				address: this.storeInfo.address
			})
		}
	}
}
</script>

<style scoped>
.container {
	background-color: #f8f8f8;
	min-height: 100vh;
}

.store-header {
	background: white;
	padding: 40rpx 30rpx;
	text-align: center;
}

.store-name {
	font-size: 36rpx;
	font-weight: bold;
	color: #333;
	display: block;
	margin-bottom: 10rpx;
}

.store-address {
	font-size: 28rpx;
	color: #666;
}

.store-info-section {
	background: white;
	margin: 20rpx;
	border-radius: 20rpx;
	padding: 30rpx;
}

.info-item {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 20rpx 0;
	border-bottom: 1rpx solid #f0f0f0;
}

.info-item:last-child {
	border-bottom: none;
}

.info-label {
	font-size: 28rpx;
	color: #666;
}

.info-value {
	font-size: 28rpx;
	color: #333;
	font-weight: bold;
}

.store-services {
	background: white;
	margin: 20rpx;
	border-radius: 20rpx;
	padding: 30rpx;
}

.section-title {
	font-size: 32rpx;
	font-weight: bold;
	color: #333;
	margin-bottom: 20rpx;
	display: block;
}

.service-list {
	display: flex;
	flex-wrap: wrap;
	gap: 20rpx;
}

.service-item {
	display: flex;
	align-items: center;
	background: #f9f9f9;
	padding: 15rpx 20rpx;
	border-radius: 25rpx;
}

.service-icon {
	font-size: 24rpx;
	margin-right: 10rpx;
}

.service-name {
	font-size: 24rpx;
	color: #333;
}

.action-buttons {
	display: flex;
	gap: 20rpx;
	padding: 30rpx;
}

.action-btn {
	flex: 1;
	height: 80rpx;
	border-radius: 40rpx;
	font-size: 28rpx;
	border: none;
}

.primary {
	background: #4A90E2;
	color: white;
}

.secondary {
	background: white;
	color: #4A90E2;
	border: 2rpx solid #4A90E2;
}
</style>
